home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part2 / 15231 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.2 KB

  1. Path: brighton.openmarket.com!decwrl!purdue!yuma!usenet
  2. From: shuyuan xuan <xuan@cs.colostate.edu>
  3. Newsgroups: comp.lang.c
  4. Subject: memory error, the tough bug for debuging !
  5. Date: Wed, 17 Apr 1996 17:18:14 -0600
  6. Organization: Colorado State University, Fort Collins, CO  80523
  7. Message-ID: <31757C36.4DFA@cs.colostate.edu>
  8. NNTP-Posting-Host: hummel.cs.colostate.edu
  9. Mime-Version: 1.0
  10. Content-Type: text/plain; charset=us-ascii
  11. Content-Transfer-Encoding: 7bit
  12. X-Mailer: Mozilla 2.01 (X11; I; HP-UX A.09.01 9000/715)
  13.  
  14. In one program, I used the following function
  15.   multiply_sm(double mat1[][4],double *arr,double *result)
  16. the third parameter is supposed to be "double result[4]"
  17.  
  18. but when I called it in the main program, I used 
  19.   multiply_sm(m,pt,result);
  20.  my error--- I defined:      double result[3] 
  21.  although it should be:      double result[4]
  22.  
  23. Resonably there is no problem in compiling,even in running.
  24. There is no core dump here. But the memory was disrupted,
  25. therfore, some very strange things happened elsewhere,
  26. which seemed completely irrelevant.
  27.  
  28. It took me quite some time to figure this out. This kind of
  29. memory error is difficult to debug. Is it any better with 
  30. c++ ? Any comment on memory error is appreciated.
  31.  
  32. Andrew x.
  33. from colorado
  34.